package com.zhangpu.hystrix.controller;

import com.zhangpu.hystrix.service.HystrixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhangpu
 * @License: (C) Copyright hualala.com Corporation Limited.
 * @Contact: zhangpu@hualala.com
 * @Date: 2021.07.20 11:21
 * @Version: 1.0
 * @Description:
 * @ProjectName: spring-cloud-eureka
 */

@RestController
public class HystrixController {

    @Autowired
    private HystrixService hystrixService;

    //@RequestMapping(value = "/hi/{name}",method = RequestMethod.GET)
    @GetMapping("/hystrix/{name}")
    public String getSpringCloudInfo(@PathVariable(value = "name") String name){
        return hystrixService.hiService(name);
    }
}